﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebNews;
using Base;

public partial class admin_WebNews_WebNewsAdd : Base.BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckRights("Basic", "A1");
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            TWebNews TWeb = new TWebNews();
            TWeb.Title = txtTitle.Text;
            TWeb.Type = dropType.SelectedValue;
            if (chkAttribute.Checked)
            { 
                TWeb.Attribute = chkAttribute.Text; 
            }
            //if (ImgUrl1.Value != "")
            //{
            //    TWeb.Picture = ImgUrl1.Value;
            //}
            TWeb.Picture = "";
            TWeb.Origin = txtOrigin.Text;
            TWeb.Detail = Detail.Value;
            IWebNews RWeb = new RWebNews();
            RWeb.Insert(TWeb);
            ShowMessage("添加网站动态信息成功！", "WebNews/WebNewsManage.aspx");
           
        }
        catch (Exception ex)
        {
            HandleErr("提交时发送错误！","index_Center.aspx");
        }
    }
   
    protected void btnCancel_Click1(object sender, EventArgs e)
    {
        Response.Write("<script language=javascript>window.location.href='WebNewsManage.aspx'</script>");
    }
}
